package com.logicfishsoftware.plugbench;

import com.google.inject.Inject;
import com.logicfishsoftware.plugbench.WPPlugBenchInjectorProvider;
import com.logicfishsoftware.plugbench.wPPlugBench.Option;
import com.logicfishsoftware.plugbench.wPPlugBench.Options;
import com.logicfishsoftware.plugbench.wPPlugBench.Plugin;
import org.eclipse.emf.common.util.EList;
import org.eclipse.xtext.junit4.InjectWith;
import org.eclipse.xtext.junit4.XtextRunner;
import org.eclipse.xtext.junit4.util.ParseHelper;
import org.eclipse.xtext.xbase.lib.Exceptions;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.junit.Test;
import org.junit.runner.RunWith;

@InjectWith(value = WPPlugBenchInjectorProvider.class)
@RunWith(value = XtextRunner.class)
@SuppressWarnings("all")
public class PlugbenchTests {
  @Inject
  private ParseHelper<Plugin> parser;
  
  @Test
  public void parsePluginModel() {
    try {
      final Plugin model = this.parser.parse(
        "entity MyEntity {\r\n       parent: MyEntity\r\n     }");
      Options _options = model.getOptions();
      EList<Option> _options_1 = _options.getOptions();
      Option _head = IterableExtensions.<Option>head(_options_1);
      final Option option = ((Option) _head);
    } catch (Exception _e) {
      throw Exceptions.sneakyThrow(_e);
    }
  }
}
